package com.adaxi.adc.business.passengertrip.feign.service;

import com.adaxi.adc.business.passengertrip.feign.FeignConfiguration;
import com.adaxi.adc.business.passengertrip.pojo.AdcRoutePrice;
import com.adaxi.adc.business.passengertrip.pojo.AdcVehicleTrip;
import com.adaxi.adc.common.common.CommonResult;
import com.adaxi.adc.common.constant.Constants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name= Constants.ADC_VEHICLE_TRIP_APPLICATION_NAME, configuration = FeignConfiguration.class)
public interface IVehicleTripFeignService {

    /**
     * 远程查询车辆行程表
     * @param id
     * @return
     */
    @GetMapping("/vehicleTrip/vehicleTripById/{id}")
    CommonResult<AdcVehicleTrip> queryById(@PathVariable("id") String id);


    /**
     * 运程修改车辆行程表中已拼人数
     * @param id
     * @param numToReduce
     * @return
     */
    @PutMapping("/vehicleTrip/reduction/{id}/{numToReduce}")
    CommonResult updateById(@PathVariable("id")String id,@PathVariable("numToReduce")Integer numToReduce);

    /**
     * 远程查询路线价格表
     * @param id
     * @return
     */
    @GetMapping("/routePrice/{id}")
    CommonResult<AdcRoutePrice> queryVARById(@PathVariable("id") String id);

    @GetMapping("/routePriceAll")
    CommonResult findAllRoutePrices();

    @GetMapping("/trips")
    public CommonResult getTrips(
            @RequestParam(name = "page", defaultValue = "1") int page,
            @RequestParam(name = "pageSize", defaultValue = "10") int pageSize
    );
}


